package c.j.a.d.b.i;

import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicReference;

/* compiled from: NetTrafficManager */
public class k {
    public final d a = new d(0.05d);
    public volatile boolean b = false;
    public final AtomicReference<l> c = new AtomicReference(l.UNKNOWN);
    public AtomicReference<l> d;
    public final ArrayList<c> e = new ArrayList();
    public int f;

    /* compiled from: NetTrafficManager */
    public static /* synthetic */ class a {
        public static final /* synthetic */ int[] a;

        /* JADX WARNING: Missing exception handler attribute for start block: B:11:0x0016 */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Can't wrap try/catch for region: R(11:0|1|2|3|(2:5|6)|7|9|10|11|12|14) */
        /* JADX WARNING: Missing block: B:15:?, code skipped:
            return;
     */
        static {
            /*
            c.j.a.d.b.i.l.values();
            r0 = 5;
            r0 = new int[r0];
            a = r0;
            r1 = 0;
            r2 = 1;
            r0[r1] = r2;	 Catch:{ NoSuchFieldError -> 0x000c }
        L_0x000c:
            r0 = 2;
            r1 = a;	 Catch:{ NoSuchFieldError -> 0x0011 }
            r1[r2] = r0;	 Catch:{ NoSuchFieldError -> 0x0011 }
        L_0x0011:
            r1 = 3;
            r2 = a;	 Catch:{ NoSuchFieldError -> 0x0016 }
            r2[r0] = r1;	 Catch:{ NoSuchFieldError -> 0x0016 }
        L_0x0016:
            r0 = a;	 Catch:{ NoSuchFieldError -> 0x001b }
            r2 = 4;
            r0[r1] = r2;	 Catch:{ NoSuchFieldError -> 0x001b }
        L_0x001b:
            return;
            */
            throw new UnsupportedOperationException("Method not decompiled: c.j.a.d.b.i.k$a.m2425clinit():void");
        }
    }

    /* compiled from: NetTrafficManager */
    public static class b {
        public static final k a = new k(null);
    }

    /* compiled from: NetTrafficManager */
    public interface c {
        void a(l lVar);
    }

    public k(a aVar) {
    }

    /* JADX WARNING: Removed duplicated region for block: B:32:0x008c  */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x0095  */
    /* JADX WARNING: Removed duplicated region for block: B:40:0x00a8 A:{Catch:{ all -> 0x00a1, all -> 0x00ec }} */
    /* JADX WARNING: Missing block: B:59:0x00ef, code skipped:
            return;
     */
    public synchronized void a(long r7, long r9) {
        /*
        r6 = this;
        monitor-enter(r6);
        r7 = (double) r7;
        r0 = 4607182418800017408; // 0x3ff0000000000000 float:0.0 double:1.0;
        r7 = r7 * r0;
        r0 = (double) r9;
        r7 = r7 / r0;
        r0 = 4620693217682128896; // 0x4020000000000000 float:0.0 double:8.0;
        r7 = r7 * r0;
        r0 = 0;
        r2 = (r9 > r0 ? 1 : (r9 == r0 ? 0 : -1));
        if (r2 == 0) goto L_0x00ee;
    L_0x0012:
        r9 = 4613937818241073152; // 0x4008000000000000 float:0.0 double:3.0;
        r0 = (r7 > r9 ? 1 : (r7 == r9 ? 0 : -1));
        if (r0 >= 0) goto L_0x001a;
    L_0x0018:
        goto L_0x00ee;
    L_0x001a:
        r9 = r6.a;	 Catch:{ all -> 0x00ec }
        r9.a(r7);	 Catch:{ all -> 0x00ec }
        r7 = r6.b();	 Catch:{ all -> 0x00ec }
        r8 = r6.b;	 Catch:{ all -> 0x00ec }
        r9 = 1;
        if (r8 == 0) goto L_0x00db;
    L_0x0028:
        r8 = r6.f;	 Catch:{ all -> 0x00ec }
        r8 = r8 + r9;
        r6.f = r8;	 Catch:{ all -> 0x00ec }
        r8 = r6.d;	 Catch:{ all -> 0x00ec }
        r8 = r8.get();	 Catch:{ all -> 0x00ec }
        r10 = 0;
        if (r7 == r8) goto L_0x003a;
    L_0x0036:
        r6.b = r10;	 Catch:{ all -> 0x00ec }
        r6.f = r9;	 Catch:{ all -> 0x00ec }
    L_0x003a:
        r7 = r6.f;	 Catch:{ all -> 0x00ec }
        r7 = (double) r7;	 Catch:{ all -> 0x00ec }
        r0 = 4617315517961601024; // 0x4014000000000000 float:0.0 double:5.0;
        r2 = (r7 > r0 ? 1 : (r7 == r0 ? 0 : -1));
        if (r2 < 0) goto L_0x00d9;
    L_0x0043:
        r7 = r6.a;	 Catch:{ all -> 0x00ec }
        if (r7 != 0) goto L_0x0049;
    L_0x0047:
        r7 = 0;
        goto L_0x00a6;
    L_0x0049:
        r7 = r6.c;	 Catch:{ all -> 0x00a1 }
        r7 = r7.get();	 Catch:{ all -> 0x00a1 }
        r7 = (c.j.a.d.b.i.l) r7;	 Catch:{ all -> 0x00a1 }
        r8 = c.j.a.d.b.i.k.a.a;	 Catch:{ all -> 0x00a1 }
        r7 = r7.ordinal();	 Catch:{ all -> 0x00a1 }
        r7 = r8[r7];	 Catch:{ all -> 0x00a1 }
        r0 = 4656510908468559872; // 0x409f400000000000 float:0.0 double:2000.0;
        r2 = 4648049066981195776; // 0x4081300000000000 float:0.0 double:550.0;
        r4 = 4639481672377565184; // 0x4062c00000000000 float:0.0 double:150.0;
        if (r7 == r9) goto L_0x0080;
    L_0x006a:
        r8 = 2;
        if (r7 == r8) goto L_0x007d;
    L_0x006d:
        r8 = 3;
        if (r7 == r8) goto L_0x0084;
    L_0x0070:
        r8 = 4;
        if (r7 == r8) goto L_0x0075;
    L_0x0073:
        r7 = 1;
        goto L_0x00a6;
    L_0x0075:
        r7 = 5183643170566569984; // 0x47efffffe0000000 float:-3.6893488E19 double:3.4028234663852886E38;
        r2 = r0;
        r0 = r7;
        goto L_0x0084;
    L_0x007d:
        r0 = r2;
        r2 = r4;
        goto L_0x0084;
    L_0x0080:
        r0 = 0;
        r2 = r0;
        r0 = r4;
    L_0x0084:
        r7 = r6.a;	 Catch:{ all -> 0x00a1 }
        r7 = r7.b;	 Catch:{ all -> 0x00a1 }
        r4 = (r7 > r0 ? 1 : (r7 == r0 ? 0 : -1));
        if (r4 <= 0) goto L_0x0095;
    L_0x008c:
        r2 = 4608308318706860032; // 0x3ff4000000000000 float:0.0 double:1.25;
        r0 = r0 * r2;
        r2 = (r7 > r0 ? 1 : (r7 == r0 ? 0 : -1));
        if (r2 <= 0) goto L_0x0047;
    L_0x0094:
        goto L_0x00a0;
    L_0x0095:
        r0 = 4605380978949069210; // 0x3fe999999999999a float:-1.5881868E-23 double:0.8;
        r2 = r2 * r0;
        r0 = (r7 > r2 ? 1 : (r7 == r2 ? 0 : -1));
        if (r0 >= 0) goto L_0x0047;
    L_0x00a0:
        goto L_0x0073;
    L_0x00a1:
        r7 = move-exception;
        r7.printStackTrace();	 Catch:{ all -> 0x00ec }
        goto L_0x0047;
    L_0x00a6:
        if (r7 == 0) goto L_0x00d9;
    L_0x00a8:
        r6.b = r10;	 Catch:{ all -> 0x00ec }
        r6.f = r9;	 Catch:{ all -> 0x00ec }
        r7 = r6.c;	 Catch:{ all -> 0x00ec }
        r8 = r6.d;	 Catch:{ all -> 0x00ec }
        r8 = r8.get();	 Catch:{ all -> 0x00ec }
        r7.set(r8);	 Catch:{ all -> 0x00ec }
        r7 = r6.e;	 Catch:{ all -> 0x00d5 }
        r7 = r7.size();	 Catch:{ all -> 0x00d5 }
    L_0x00bd:
        if (r10 >= r7) goto L_0x00d9;
    L_0x00bf:
        r8 = r6.e;	 Catch:{ all -> 0x00d5 }
        r8 = r8.get(r10);	 Catch:{ all -> 0x00d5 }
        r8 = (c.j.a.d.b.i.k.c) r8;	 Catch:{ all -> 0x00d5 }
        r9 = r6.c;	 Catch:{ all -> 0x00d5 }
        r9 = r9.get();	 Catch:{ all -> 0x00d5 }
        r9 = (c.j.a.d.b.i.l) r9;	 Catch:{ all -> 0x00d5 }
        r8.a(r9);	 Catch:{ all -> 0x00d5 }
        r10 = r10 + 1;
        goto L_0x00bd;
    L_0x00d5:
        r7 = move-exception;
        r7.printStackTrace();	 Catch:{ all -> 0x00ec }
    L_0x00d9:
        monitor-exit(r6);
        return;
    L_0x00db:
        r8 = r6.c;	 Catch:{ all -> 0x00ec }
        r8 = r8.get();	 Catch:{ all -> 0x00ec }
        if (r8 == r7) goto L_0x00ec;
    L_0x00e3:
        r6.b = r9;	 Catch:{ all -> 0x00ec }
        r8 = new java.util.concurrent.atomic.AtomicReference;	 Catch:{ all -> 0x00ec }
        r8.<init>(r7);	 Catch:{ all -> 0x00ec }
        r6.d = r8;	 Catch:{ all -> 0x00ec }
    L_0x00ec:
        monitor-exit(r6);
        return;
    L_0x00ee:
        monitor-exit(r6);
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.j.a.d.b.i.k.a(long, long):void");
    }

    /* JADX WARNING: Missing block: B:22:0x0039, code skipped:
            return r0;
     */
    public synchronized c.j.a.d.b.i.l b() {
        /*
        r6 = this;
        r0 = c.j.a.d.b.i.l.UNKNOWN;
        monitor-enter(r6);
        r1 = r6.a;	 Catch:{ all -> 0x0040 }
        if (r1 != 0) goto L_0x0009;
    L_0x0007:
        monitor-exit(r6);
        return r0;
    L_0x0009:
        r1 = r1.b;	 Catch:{ all -> 0x003a }
        r3 = 0;
        r5 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1));
        if (r5 >= 0) goto L_0x0012;
    L_0x0011:
        goto L_0x0038;
    L_0x0012:
        r3 = 4639481672377565184; // 0x4062c00000000000 float:0.0 double:150.0;
        r5 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1));
        if (r5 >= 0) goto L_0x001e;
    L_0x001b:
        r0 = c.j.a.d.b.i.l.POOR;	 Catch:{ all -> 0x003a }
        goto L_0x0038;
    L_0x001e:
        r3 = 4648049066981195776; // 0x4081300000000000 float:0.0 double:550.0;
        r5 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1));
        if (r5 >= 0) goto L_0x002a;
    L_0x0027:
        r0 = c.j.a.d.b.i.l.MODERATE;	 Catch:{ all -> 0x003a }
        goto L_0x0038;
    L_0x002a:
        r3 = 4656510908468559872; // 0x409f400000000000 float:0.0 double:2000.0;
        r5 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1));
        if (r5 >= 0) goto L_0x0036;
    L_0x0033:
        r0 = c.j.a.d.b.i.l.GOOD;	 Catch:{ all -> 0x003a }
        goto L_0x0038;
    L_0x0036:
        r0 = c.j.a.d.b.i.l.EXCELLENT;	 Catch:{ all -> 0x003a }
    L_0x0038:
        monitor-exit(r6);
        return r0;
    L_0x003a:
        r1 = move-exception;
        r1.printStackTrace();	 Catch:{ all -> 0x0040 }
        monitor-exit(r6);
        return r0;
    L_0x0040:
        r0 = move-exception;
        monitor-exit(r6);
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.j.a.d.b.i.k.b():c.j.a.d.b.i.l");
    }
}
